package spring.core.examples.xml;

import org.springframework.context.ApplicationEvent;

/**
 * Demonstrates how to write a custom event.
 * 
 * @see Publisher
 * @see Subscriber
 */
public class Event extends ApplicationEvent {

	/** The message. */
	private final String message;

	/**
	 * Instantiates a new event.
	 * 
	 * @param source
	 *            the source
	 * @param message
	 *            the message
	 */
	public Event(Object source, String message) {
		super(source);
		this.message = message;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.util.EventObject#toString()
	 */
	@Override
	public String toString() {
		return this.getClass().getSimpleName() + "(" + this.message + ")";
	}

}
